<!DOCTYPE html>
<html lang="en">
<head>
    <!-- 作用在 flex 容器上 -->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <div class="father">
        <div class="son">son1</div>
        <div class="son">son2</div>
        <div class="son">son3</div>
        <div class="son">son4</div>
    </div>
    <style>
    .father {
      height: 420px;
      width: 420px;
      padding: 10px;
      margin: 100px auto;
      border: 1px red solid;
      box-sizing: border-box;
      /* display: flex; */
      /* flex-direction: row; 默认开启了主轴排序(由左向右)*/
    }
    .son {
      height: 100px;
      width: 100px;
      margin-right: 50px;
      margin-bottom: 50px;
      color: white;
      text-align: center;
      font-size: 30px;
      line-height: 100px;
    }
    .son:nth-child(1) {
      background-color: olivedrab;
    }
    .son:nth-child(2) {
      background-color: red;
    }
    .son:nth-child(3) {
      background-color: orange;
      margin-bottom: 0px;
      margin-right: 0px;
    }
    </style>
</head>
<body>
    <!-- flexbox 布局 -->
    <div class="father">
        <div class="son">son1</div>
        <div class="son">son1</div>
        <div class="son">son1</div>
    </div>
</body>
</html>